#字典的基本概念

"""
dic={1:1,2:"zhangsan"}
print(dic)


name=123
list={name:"张三","age":[1,2,3]}
print(list[name])
print(list["age"])

"""

#字典的增删改查
dictMap={"key1":123,"key2":456}
print(dictMap)

dictMap["key1"]=111
print(dictMap)

#增加


#删除
# dictMap.pop("key2")
# print(dictMap)

#查询 直接根据key查询
dictMap.get("key2")
print("===========")
print(dictMap)


dict={
    "赵四":"特别歪嘴",
    "王五":"巅峰对决快递师傅",
    "大脚":"但是发发生",
    "大脑袋":"实打实大撒的发生"
}

# name=input("请输入一个名字：")
# val = dict.get(name)
# if val is None:
#     print("这里没有这个人~~~")
# else:
#     print(val)

print("===========")

for  item in    dict.items():
    # key=item[0]
    # val=item[1]
    #解构写法
    key,value = item
    print(key,value)

print("===========")
#解构赋值
a,b=(1,2)
c=a//b  #除法，向下取整
print("c=",c)
print(a,b)


print("++++++++")
#删除姓王的
listDict={
    "赵四": "特别歪嘴",
    "王五": "巅峰对决快递师傅",
    "王七":"1233",
    "大脚": "但是发发生",
    "大脑袋": "实打实大撒的发生"
}

temp=[]
for key in listDict:
    # print(key)
    if key.startswith("王"):
        temp.append(key)

for item in temp:
    listDict.pop(item)

print(listDict)




